Component({
  /**
   * 组件的一些选项
   */
  options: {
    addGlobalClass: true,
    multipleSlots: true
  },
  /**
   * 组件的对外属性
   */
  properties: {
    bgColor: {
      type: String,
      default: ''
    },
    isCustom: {
      type: [Boolean, String],
      default: false
    },
    isBack: {
      type: [Boolean, String],
      default: false
    },
    bgImage: {
      type: String,
      default: ''
    },
  },
  /**
   * 组件的初始数据
   */
  data: {
    StatusBar: 0,
    CustomBar: 0,
    Custom: 0
  },
  /**
   * 组件生命周期
   */
  lifetimes: {
    attached() {
      wx.getSystemInfo({
        success: e => {
          console.log(e)
          var StatusBar = e.statusBarHeight;
          //let custom =  wx.getMenuButtonBoundingClientRect();
          // console.log(custom)
          var Custom = 50;
          var CustomBar = 90 - e.statusBarHeight;
          this.setData({
            StatusBar,
            CustomBar,
            Custom
          })
        }
      })
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    BackPage() {
      wx.navigateBack({
        delta: 1
      });
    },
    toHome() {
      wx.reLaunch({
        url: '/pages/index/index',
      })
    }
  }
})